  <div>
    <form class="form-horizontal" role="form" name="tradeComplForm" novalidate>
      <div class="form-ctrl md-whiteframe-z1">
        <div class="form-search" style="height:260px;" ng-class="{true: 'shou'}[flag.formIsFold]" ng-switch="tradeCompl.timeType.timeTypeCode">
        <div>
          <label style="">渠道</label>
          <md-select ng-model="tradeCompl.businessLine">
            <md-select-label>{{tradeCompl.businessLine ? _getNames(tradeCompl.businessLine,'businessLineName',selector.businessLine) : "天猫"}}</md-select-label>
            <md-option ng-value="businessLine" ng-repeat="businessLine in selector.businessLine" >{{businessLine.businessLineName}}</md-option>
          </md-select>
        </div>
        <div ng-show="tradeCompl.businessLine && tradeCompl.businessLine.businessLineName === '银行总对总'">
          <label style="">机构</label>
          <md-select ng-model="tradeCompl.agencyType">
            <md-select-label>{{tradeCompl.agencyType ? _getNames(tradeCompl.agencyType,'name',selector.agencyType) : "省公司"}}</md-select-label>
            <md-option ng-value="agencyType" ng-repeat="agencyType in selector.agencyType" >{{agencyType.name}}</md-option>
          </md-select>
        </div>
        <div ng-show="tradeCompl.businessLine && tradeCompl.businessLine.businessLineName === '银行总对总'">
          <md-select multiple ng-model="tradeCompl.agencyCode">
            <md-select-label>{{tradeCompl.agencyCode ? _getNames(tradeCompl.agencyCode,'agencyName',selector.agencys) : "全部"}}</md-select-label>
            <md-option ng-value="" ng-click="_checkAll(tradeCompl,'agencyCode')">全部</md-option>
            <md-option ng-value="agency" ng-repeat="agency in selector.agencys">{{agency.agencyName}}</md-option>
          </md-select>
        </div>
        <div ng-show="!tradeCompl.businessLine || tradeCompl.businessLine.businessLineName !== '银行总对总'"></div>
        <div ng-show="!tradeCompl.businessLine || tradeCompl.businessLine.businessLineName !== '银行总对总'"></div>
        <div></div>
        <div></div>
        <div>
          <label style="">时间粒度</label>
          <md-select ng-model="tradeCompl.timeType">
            <md-select-label>{{tradeCompl.timeType ? _getNames(tradeCompl.timeType,'timeTypeName',selector.timeType) : "日"}}</md-select-label>
            <md-option ng-value="timeType" ng-repeat="timeType in selector.timeType" >{{timeType.timeTypeName}}</md-option>
          </md-select>
        </div>
        <input-quarter-group start-time="tradeCompl.quarter.startTime" end-time="tradeCompl.quarter.endTime" ng-switch-when="4"></input-quarter-group>
        <div ng-if="!tradeCompl.timeType || tradeCompl.timeType.timeTypeCode !== '4'">
        <md-input-container flex>
          <label >开始时间</label>
          <input name="dateStartTime" type="date" time-validate="day"  end-time="date.endTime" ng-model="date.startTime"  ng-switch-default required>
          <div ng-messages="tradeComplForm.dateStartTime.$error">
            <div ng-message="date">请正确输入时间</div>
            <div ng-message="time-error">开始时间不应大于结束时间</div>
          </div>
          <input name="monthStartTime" time-validate="month" ng-model="date.startTime"  end-time="date.endTime" type="month" ng-switch-when="3" required>
          <div ng-messages="tradeComplForm.monthStartTime.$error">
            <div ng-message="date">请正确输入时间</div>
            <div ng-message="time-error">开始时间不应大于结束时间</div>
          </div>
          <input ng-model="date.startTime"  time-validate="year" end-time="date.endTime" type="number" ng-switch-when="5" name="startQuarter" required>
          <div ng-messages="tradeComplForm.startQuarter.$error">
            <div ng-message="required">请正确输入时间</div>
            <div ng-message="time-error">开始时间不应大于结束时间</div>
          </div>
        </md-input-container>
        </div>
        <div ng-if="!tradeCompl.timeType || tradeCompl.timeType.timeTypeCode !== '4'">
          <md-input-container flex>
            <label>结束时间</label>
            <input name="dateEndTime" time-validate="day" type="date" ng-model="date.endTime"  start-time="date.startTime" ng-switch-default required>
            <div ng-messages="tradeComplForm.dateEndTime.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">结束时间不应小于开始时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
            <input name="monthEndTime" time-validate="month" ng-model="date.endTime"  type="month" start-time="date.startTime" ng-switch-when="3" required>
            <div ng-messages="tradeComplForm.monthEndTime.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">结束时间不应小于开始时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
            <input ng-model="date.endTime"  time-validate="year" start-time="date.startTime" type="number" ng-switch-when="5" name="endQuarter" required>
              <div ng-messages="tradeComplForm.endQuarter.$error">
              <div ng-message="required">请正确输入时间</div>
              <div ng-message="time-error">结束时间不应小于开始时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container >
        </div>
        </div>
        <i class="glyphicon glyphicon-chevron-up shrinkage" ng-show="isQuery" ng-click="flag.formIsFold = true"></i>
        <md-button ng-click="tradeComplQuery()" class="md-fab md-primary md-hue-1" aria-label="Profile">
        <i class="glyphicon glyphicon-search"  ng-show="!flag.formIsFold"></i>
        <i class="glyphicon glyphicon-arrow-down" style="margin-top:28px;" ng-show="flag.formIsFold"></i>
        </md-button>
      </div>
    </form>
    <div class="table-info">
      <div >
        <div class="menus"></div>
        <div id="tradeComplChart"  style="height:479px"></div>
      </div>
    </div>
  </div>